<!DOCTYPE html>
<html lang="zh-cn"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta http-equiv="Content-Language" content="zh-CN">
<meta name="author" content="管雷鸣">
<title>在线客服</title>
<script src="https://res.weiunity.com/msg/msg.js"></script>
<script src="https://res.weiunity.com/kefu/kefu.js"></script>
<link rel="stylesheet" type="text/css" href="https://res.weiunity.com/kefu/css/style.css" media="screen">

<style>
#head{
	display:none;
}
#chatcontent{
	padding-top:0px;
}
</style>
</head>
<body>
<script type="text/javascript">

msg.loading('加载中');
request.post('/kefu/chat/config/getNetConfig.json',{},function(data){
	msg.close();
	
	if(data.result != '1'){
		msg.failure(data.info);
	}else {
		//成功
		console.log(data);
		
		kefu.api.domain =  data.api;
		kefu.socket.url = data.socket;
		
		//kefu.js 初始化
		kefu.init();
		//打开聊天窗口
		//kefu.ui.chat.entry('9752d379cbe641039de8c68974319bb9');
		
		//客服坐席的id
		var kefu_zuoxiid = getUrlParams('id');
		if(typeof(kefu_zuoxiid) == 'undefined' || kefu_zuoxiid == null || kefu_zuoxiid == ''){
			msg.failure('请传入客服坐席的id');
		}else{
			kefu.ui.chat.entry(kefu_zuoxiid);
		}
	}
});

</script>

</body>
</html>